package edu.bbu.commonproject.desktop.gui.view.swing.setup;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.HeaderButton;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TexturedPanel;

/**
 * The logo setup panel.
 */
public class LogoSetupPanel extends TexturedPanel
{
	/** The logo image. */
	private Image logoImage;
	
	/** The logo texture. */
	private Image logoTexture;
	
	/** The synchronize setup button icon. */
	private ImageIcon synchronizeSetupButtonIcon;
	
	/** The privacy setup button icon. */
	private ImageIcon privatcySetupButtonIcon;
	
	/** The back to files button icon. */
	private ImageIcon backToFilesButtonIcon;
	
	/** The synchronize setup button. */
	private HeaderButton synchronizeSetupButton;
	
	/** The priavcy setup button. */
	private HeaderButton privatcySetupButton;
	
	/** The back to file button. */
	private HeaderButton backToFilesButton;
	
	/**
	 * The constructor.
	 */
	public LogoSetupPanel()
	{
		logoImage = Design.COMPONENT_LOGO;
		logoTexture = Design.COMPONENT_HEADEREXTURE;
		synchronizeSetupButtonIcon = new ImageIcon(Design.HEADER_BUTTON_SYNCSETUP);
		privatcySetupButtonIcon = new ImageIcon(Design.HEADER_BUTTON_PRIVACY);
		backToFilesButtonIcon = new ImageIcon(Design.HEADER_BUTTON_SETUPEXIT);
		
		this.setTexture(logoTexture);
		this.setPreferredSize(new Dimension(900, 80));
		this.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 0));
		
		setComponents();
	}
	
	/**
	 * It sets up the components.
	 */
	private void setComponents()
	{	
		synchronizeSetupButton = new HeaderButton();
		synchronizeSetupButton.setIcon(synchronizeSetupButtonIcon);
		
		privatcySetupButton = new HeaderButton();
		privatcySetupButton.setIcon(privatcySetupButtonIcon);
		
		backToFilesButton = new HeaderButton();
		backToFilesButton.setIcon(backToFilesButtonIcon);

		this.add(synchronizeSetupButton);
		this.add(privatcySetupButton);
		this.add(backToFilesButton);
	}
	
	/**
	 * The paintComponents method.
	 */
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		g.drawImage(logoImage, 0, 0, null);
	}
	
	/**
	 * Gets the synchronized setup buttton.
	 * @return the synchronized setup buttton.
	 */
	public HeaderButton getSynchronizeSetupButton()
	{
		return synchronizeSetupButton;
	}
	
	/**
	 * Gets the privacy setup button.
	 * @return the privacy setup button.
	 */
	public HeaderButton getPrivatcySetupButton()
	{
		return privatcySetupButton;
	}
	
	/**
	 * Gets the back to file button.
	 * @return  the back to file button.
	 */
	public HeaderButton getBackToFilesButton()
	{
		return backToFilesButton;
	}
}
